// 通用生成器
@mixin spacing-utils($prop, $prefix) {
  @for $i from 1 through 100 {
    .#{$prefix}-#{$i} {
      #{$prop}: #{$i}px !important;
    }
  }
}

// 使用
@include spacing-utils(margin-top, mt);
@include spacing-utils(margin-bottom, mb);
@include spacing-utils(margin-left, ml);
@include spacing-utils(margin-right, mr);
@include spacing-utils(padding-top, pt);
@include spacing-utils(padding-bottom, pb);
@include spacing-utils(padding-left, pl);
@include spacing-utils(padding-right, pr);
